package com.trt.api.controller.user;

import com.trt.pojo.dto.RegistLoginBO;
import com.trt.utils.ApiResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

/**
 * @author tanrentao
 * @date 2021-12-01
 * @desc
 */
@Api(value = "用户注册登录", tags = "{用户注册登录的controller}")
@RequestMapping("passport")
public interface PassportControllerApi {

    @ApiOperation(value = "获得短信验证码", notes = "获得短信验证码", httpMethod = "GET")
    @GetMapping("/getSMSCode")
    public ApiResult getSMSCode(@RequestParam String mobile, HttpServletRequest request);

    @ApiOperation(value = "一键注册登录", notes = "一键注册登录", httpMethod = "POST")
    @PostMapping("/login")
    public ApiResult login(@Valid @RequestBody RegistLoginBO registLoginBO, BindingResult result, HttpServletResponse response);

    @ApiOperation(value = "用户退出登录", notes = "用户退出登录", httpMethod = "POST")
    @PostMapping("/logout")
    public ApiResult logout(@RequestParam String userId, HttpServletResponse response);


}
